package com.cskaoyan.test;

import com.cskaoyan.utils.JDBCUtils;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * 创建日期: 2022/04/21 11:15
 *
 * @author ciggar
 */
public class JDBC4Update {

    public static void main(String[] args) throws SQLException {

        // 获取连接
        Connection connection = JDBCUtils.getConnection();

        // 获取Statement
        Statement statement = connection.createStatement();

        // 执行SQL语句，获取结果
        int affectedRows = statement.executeUpdate("insert into user values (20,'阿呆','2000-05-20')");

        System.out.println(affectedRows);


        // 关闭连接
        JDBCUtils.close(connection,statement,null);

    }
}
